const tokenKey = 'heima-toutiao-token'

const saveToken = tokenObj => {
  localStorage.setItem(tokenKey, JSON.stringify(tokenObj))
}

const removeToken = () => {
  localStorage.removeItem(tokenKey)
}

const getToken = () => {
  return JSON.parse(localStorage.getItem(tokenKey))
}

export { saveToken, removeToken, getToken }
